HAL IWDG constants migration

This section provides information about the HAL IWDG constants migration.

Related Concept: Define statements and enumerations redirected to LL equivalents

HAL IWDG prescaler constants

In HAL2, these constants have been removed and is keep it in LL file.

HAL1

HAL2

#define IWDG_PRESCALER_4
#define IWDG_PRESCALER_8
#define IWDG_PRESCALER_16
#define IWDG_PRESCALER_32
#define IWDG_PRESCALER_64
#define IWDG_PRESCALER_128
#define IWDG_PRESCALER_256
#define IWDG_PRESCALER_512
#define IWDG_PRESCALER_1024

These defines have been removed. In HAL2, users no longer provide values for the IWDG counter, prescaler, and window registers directly. Instead, users specify the maximum and minimum time intervals in milliseconds, microseconds, or seconds, and the HAL IWDG driver internally calculates the corresponding prescaler,counter, and window register values.

For direct register-level control of the IWDG, users should utilize the LL driver rather than the HAL.


HAL IWDG status constants

HAL1

HAL2

#define IWDG_STATUS_DISABLE
#define IWDG_STATUS_ENABLE

Removed; In HAL2, use the HAL_IWDG_GetState() API to retrieve the current IWDG state, either IDLE or ACTIVE.

For register-level control of the IWDG, the LL driver (e.g., LL_IWDG_IsActiveFlag_ONF) should be used instead of the HAL.


HAL IWDG window status constants

HAL1

HAL2

#define IWDG_WINDOW_DISABLE

Relocated to the .c file as it is not intended for user access.


HAL IWDG early wakeup interrupt status constants

HAL1

HAL2

#define IWDG_EWI_DISABLE

Removed; When early wakeup is not required, the user should set the early_wakeup_time parameter to zero within the HAL_IWDG_Start() function.